home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_kindling.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  100 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_Kindling.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message        activated
  14. message        callback
  15.  
  16. cog            talkCog                    local
  17.  
  18. keyframe    get=in_pickup_med.key    local
  19.  
  20. sound        foundSnd=INXJ185.wav    local
  21.  
  22. thing        player                    local
  23. thing        item=-1                    local
  24.  
  25. int            bin=92                    local
  26.  
  27. end
  28.  
  29. # ===================================================================
  30.  
  31. code
  32.  
  33. activated:
  34.  
  35.     player = GetSourceRef();
  36.     item = GetSenderRef();
  37.  
  38.     # Disable player controls and stuff
  39.     if (MakeMeStop() == -1)
  40.         return;
  41.     DeselectWeaponWait(player);
  42.  
  43.     StartCutscene(0);
  44.  
  45.     if (GetInv(player, bin) < GetInvMax(player, bin))
  46.     {
  47.         CaptureThing(player);
  48.         PlayKey(player, get, 5, 0x12, 0); 
  49.     }
  50.     else
  51.     {
  52.         ClearActorFlags(player, 0x200000);
  53.         EndCutscene();
  54.         return;
  55.     }
  56.  
  57.     talkCog = GetCogByIndex(0);
  58.     SendMessage(talkCog, 27);
  59.  
  60.     if (Rand() < 0.5)
  61.     {
  62.         SetExtCamOffset('0.15 -0.05 0.04');
  63.     }
  64.     else
  65.     {
  66.         SetExtCamOffset('-0.15 -0.05 0.04');
  67.     }
  68.  
  69.     SetExtCamLookOffset('0.0 0.02 0.0');
  70.  
  71.     return;
  72.  
  73. # -------------------------------------------------------------------
  74.  
  75. callback:
  76.  
  77.     ReleaseThing(player);
  78.  
  79.     if (item != -1)
  80.     {
  81.         DestroyThing(item);
  82.         item = -1;
  83.     }
  84.  
  85.     ChangeInv(player, bin, 1.0);
  86.     SetInvAvailable(player, bin, 1);
  87.     JonesInvItemChanged(bin);
  88.  
  89.     RestoreExtCam();
  90.  
  91.     Sleep(1.0);
  92.     PlayVoice(player, foundSnd, 1.0, 0);
  93.  
  94.     ClearActorFlags(player, 0x200000);
  95.     EndCutscene();
  96.  
  97.     return;
  98.  
  99. end
  100.